//
//  ForgetViewController.m
//  01-UIViewHomeWork
//
//  Created by dllo on 16/7/16.
//  Copyright © 2016年 QC.L. All rights reserved.
//  忘记密码

#import "ForgetViewController.h"
#define WIDTH self.view.frame.size.width
#define HEIGHT self.view.frame.size.height
@interface ForgetViewController ()

@end

@implementation ForgetViewController

- (void)viewDidLoad {
    [super viewDidLoad];
    self.view.backgroundColor = [UIColor whiteColor];
    [self creatSubviews];
}
- (void)creatSubviews
{
    UIButton *backButton = [UIButton buttonWithType:UIButtonTypeCustom];
    backButton.frame = CGRectMake(20, 30, 50, 50);
    [backButton setTitleColor:[UIColor colorWithRed:0.00 green:0.73 blue:0.58 alpha:1.00] forState:UIControlStateNormal];
    [backButton setTitle:@"返回" forState:UIControlStateNormal];
    [backButton addTarget:self action:@selector(backButtonDicClicked:) forControlEvents:UIControlEventTouchUpInside];
    [self.view addSubview:backButton];
    
    UILabel *titleLabel = [[UILabel alloc] initWithFrame:CGRectMake(WIDTH * 0.3, HEIGHT * 0.1, WIDTH * 0.4, 60)];
    titleLabel.text = @"验证手机";
    titleLabel.textAlignment = NSTextAlignmentCenter;
    titleLabel.font = [UIFont systemFontOfSize:20];
    [self.view addSubview:titleLabel];
    
    UIButton *telButton = [UIButton buttonWithType:UIButtonTypeCustom];
    telButton.frame = CGRectMake(25, HEIGHT * 0.2, 20, 20);
    [telButton setImage:[UIImage imageNamed:@"icon_telephone"] forState:UIControlStateNormal];
    [self.view addSubview:telButton];
    
    UITextField *telTextField = [[UITextField alloc] initWithFrame:CGRectMake(telButton.frame.origin.x + telButton.frame.size.width, telButton.frame.origin.y, WIDTH * 0.8, telButton.frame.size.height)];
    telTextField.placeholder = @"手机号(仅支持中国大陆号)";
    [self.view addSubview:telTextField];
    
    UIView *lineOne = [[UIView alloc] initWithFrame:CGRectMake(telButton.frame.origin.x, telButton.frame.origin.y + telButton.frame.size.height + 5, telButton.frame.size.width + telTextField.frame.size.width, 1)];
    lineOne.backgroundColor = [UIColor blackColor];
    [self.view addSubview:lineOne];
    
    UIButton *verfButton = [UIButton buttonWithType:UIButtonTypeCustom];
    verfButton.frame = CGRectMake(telButton.frame.origin.x, HEIGHT * 0.27, telButton.frame.size.width, telButton.frame.size.height);
    [verfButton setImage:[UIImage imageNamed:@"icon_safe"] forState:UIControlStateNormal];
    [self.view addSubview:verfButton];
    
    UITextField *verfTextField = [[UITextField alloc] initWithFrame:CGRectMake(telTextField.frame.origin.x, verfButton.frame.origin.y, telTextField.frame.size.width, telTextField.frame.size.height)];
    verfTextField.placeholder = @"验证码";
    [self.view addSubview:verfTextField];
    
    UIView *lineTwo = [[UIView alloc] initWithFrame:CGRectMake(verfButton.frame.origin.x, verfButton.frame.origin.y + verfButton.frame.size.height + 5, verfButton.frame.size.width + verfTextField.frame.size.width, 1)];
    lineTwo.backgroundColor = [UIColor blackColor];
    [self.view addSubview:lineTwo];
    
    UIButton *nextButton = [UIButton buttonWithType:UIButtonTypeCustom];
    nextButton.backgroundColor = [UIColor colorWithRed:0.00 green:0.71 blue:0.55 alpha:1.00];
    nextButton.frame = CGRectMake(25, HEIGHT * 0.38, WIDTH * 0.9, 50);
    [nextButton setTitle:@"下一步" forState:UIControlStateNormal];
    [self.view addSubview:nextButton];
    
    UILabel *labelInfo = [[UILabel alloc] initWithFrame:CGRectMake(50, HEIGHT * 0.5, WIDTH * 0.45, 20)];
    labelInfo.text = @"邮箱用户找回密码,请";
    [labelInfo sizeToFit];
    [self.view addSubview:labelInfo];
    
    UIButton *mailButton = [UIButton buttonWithType:UIButtonTypeCustom];
    mailButton.frame = CGRectMake(labelInfo.frame.origin.x + labelInfo.frame.size.width, labelInfo.frame.origin.y, 80, 20);
    [mailButton setTitleColor:[UIColor colorWithRed:0.12 green:0.60 blue:0.49 alpha:1.00] forState:UIControlStateNormal];
    [mailButton setTitle:@"点击这里" forState:UIControlStateNormal];
    [self.view addSubview:mailButton];
}

- (void)backButtonDicClicked:(UIButton *)sender
{
    [self.navigationController popViewControllerAnimated:YES];
}

- (void)didReceiveMemoryWarning {
    [super didReceiveMemoryWarning];
    // Dispose of any resources that can be recreated.
}

/*
#pragma mark - Navigation

// In a storyboard-based application, you will often want to do a little preparation before navigation
- (void)prepareForSegue:(UIStoryboardSegue *)segue sender:(id)sender {
    // Get the new view controller using [segue destinationViewController].
    // Pass the selected object to the new view controller.
}
*/

@end
